package com.xgst.lib.http;

import com.blankj.utilcode.util.LogUtils;
import com.hjq.http.config.IRequestLogStrategy;

public class LogStrategy implements IRequestLogStrategy {
    @Override
    public void printLog(String tag, String log) {
        //LogUtils.i("printLog "+tag+"  "+log);
    }

    @Override
    public void printJson(String tag, String json) {
        LogUtils.i(json);
    }

    @Override
    public void printKeyValue(String tag, String key, String value) {
        LogUtils.i(key+" : "+value);
    }

    @Override
    public void printThrowable(String tag, Throwable throwable) {
        LogUtils.i(throwable.getMessage());
    }

    @Override
    public void printStackTrace(String tag, StackTraceElement[] stackTrace) {
        for (int i = 0; i < stackTrace.length; i++) {
            if(i >= 3){
                return;
            }
            LogUtils.i(stackTrace[i]);
        }
    }
}
